﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BitmapTagger;

namespace BitmapTaggerSampleApplication
{
	class Program
	{
		[STAThread]
		static void Main(string[] args)
		{
			string jpegLocation = @"C:\Users\Chris\Desktop\TaggerTests\mytest.jpg";
			string pngLocation = @"C:\Users\Chris\Desktop\TaggerTests\mytest.png";

			////Load image with default values: load all tag systems, 
			////precedence Exif > XMPExif > XMP)
			//var tagger = BitmapTagger.BitmapTagger.Create(jpegLocation);

			////Load image with specified tag systems and tag precedence
			//tagger = BitmapTagger.BitmapTagger.Create(jpegLocation, 
			//    true, false, false, TagPrecedence.XMP_XMPExif_Exif);

			//Load png image directly with png tagger class
			//Load with default values: load all tag systems,
			//precedence: Exif > XMPExif > XMP
			var pngTagger = new PngTagger(pngLocation);

			//Load png image directly with png tagger class
			//Load with specified tag systems and tag precedence
			pngTagger = new PngTagger(pngLocation, true, false, 
				TagPrecedence.XMP_Exif_XMPExif);

			//Load jpeg image directly with jpeg tagger class
			//Load with default values: load all tag system,
			//precedence: Exif > XMPExif > XMP
			var jpegTagger = new JpegTagger(jpegLocation);

			//Load jpeg image directly with jpeg tagger class
			//Load with specified tag systems and tag precedence
			jpegTagger = new JpegTagger(jpegLocation, true, false, false, 
				TagPrecedence.XMP_XMPExif_Exif);

			//string imageLocation = 
			//    @"C:\Users\Chris\Desktop\TaggerTests\mytest.jpg";

			//var tagger = 
			//    BitmapTagger.BitmapTagger.Create(imageLocation);

			////If the Image Description information was read print 
			////to console
			//if (tagger.ImageDescription != null)
			//    Console.WriteLine("Image Description is: {0}", 
			//        tagger.ImageDescription);

			////Change the Image Description to a new value
			//tagger.ImageDescription = "My New Description";

			////If the DateTimeDigitized exists delete it
			//if (tagger.DateTimeDigitized != null)
			//    tagger.DateTimeDigitized = null;


			string imageLocation =
				@"C:\Users\Chris\Desktop\TaggerTests\mytest.jpg";

			var tagger =
				BitmapTagger.BitmapTagger.Create(imageLocation);

			//Delete DateTimeDigitized if it exists
			if (tagger.DateTimeDigitized != null)
				tagger.DateTimeDigitized = null;

			//Set the Image Description
			tagger.ImageDescription = "Hello World";

			//Save directly back to the image's original location 
			//with the tag information saved to all tag systems
			tagger.Save();

			//Save the image with the new tag information to a 
			//different location from the one it was loaded from 
			//with the tag information 
			//saved to all tag systems
			tagger.Save(@"C:\Users\Chris\Desktop\TaggerTests\mytest1.jpg");

			//Save back to the image's original location 
			//only saving the tag information to the specified 
			//tag systems
			tagger.Save(true, false, false);

			//Save the image with the new tag information to a 
			//different location only saving teh tag infromation 
			//to the specified tag systems
			tagger.Save(@"C:\Users\Chris\Desktop\TaggerTests\mytest1.jpg",
				true, true, false);
		}
	}
}
